Opened 12 years ago

Closed 11 years ago

#4458 closed Feature Requests (wontfix)

is_iequal optimization

Reported by: olafvdspek@… Owned by: Marshall Clow
Milestone: Boost 1.44.0 Component: algorithm
Version: Boost 1.43.0 Severity: Optimization
Keywords: Cc:

Description

Wouldn't return Arg1 == Arg2
std::toupper<T1>(Arg1,m_Loc)==std::toupper<T2>(Arg2,m_Loc);

be faster, since it might avoid the toupper calls?

            template< typename T1, typename T2 >
                bool operator()( const T1& Arg1, const T2& Arg2 ) const
            {
                #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL)
                    return std::toupper(Arg1)==std::toupper(Arg2);
                #else
                    return std::toupper<T1>(Arg1,m_Loc)==std::toupper<T2>(Arg2,m_Loc);
                #endif
            }

Change History (9)

comment:1 by anonymous, 12 years ago

Argh, I hate Trac!

return Arg1 == Arg2 || std::toupper<T1>(Arg1,m_Loc)==std::toupper<T2>(Arg2,m_Loc); 

comment:2 by anonymous, 12 years ago

Hi,

Can you provide some simple measures, that will support your proof? The idea seems valid, but I would like to see the facts.

Pavol.

comment:3 by olafvdspek@…, 12 years ago

Benchmarks are either simple or good, but not both. ;)

I could try to generate some numbers if you really wish.

comment:4 by anonymous, 12 years ago

Pavol?

comment:5 by Pavol Droba, 12 years ago

The change's not there yet. Have you done some testing?

comment:6 by Marshall Clow, 11 years ago

Component: string_algoalgorithm
Owner: changed from Pavol Droba to Marshall Clow

comment:7 by Marshall Clow, 11 years ago

Olaf - do you have any numbers to show that this will be a speed up?

Thanks, Marshall

comment:8 by Olaf van der Spek <olafvdspek@…>, 11 years ago

Nope. Let's just drop the idea. If the arguments aren't equal, the change won't help at all.

comment:9 by Marshall Clow, 11 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.