... Now it seems to lag and take a much longer time to do anything. ...
Have a look here...
More Info Here...
Thomas A Reed > http://www.thesafemac.com/mpg/
... I have noticed the problem while doing many different tasks on the computer.
... and I have 4 GB of RAM.
4 GB is not an abundant amount. You can read this KB article regarding memory limitations and decide if you would benefit by adding more (you probably will):
More memory is not a panacea for everything though. Poorly written apps or system modifications will degrade performance no matter how much memory you have.
Also read the following - it's very cursory, but it makes reference to Disk Utility at the end, which you should run to rule out disk corruption that may be causing this problem:
The "repair a disk" link at the end points to nothing useful so use this one instead: Disk Utility.
Back up your hard disk. The symptoms you describe can presage a hard disk failure. You have insufficient information to conclude that's the cause of your problems but you should have backups anyway.
If none of these suggestions help, then write back for more ideas.